/*
* 这里放一些比较简单的controller
* */


HW.App.controller('SecondCategoryCtrl', function($scope, $stateParams){
    HW.helper.loading.show();

    HW.request.getSecondCategoryData({
        id : $stateParams.cid
    }, function(data){
        $scope.view_title = data.title;

        var d = data.data,
            rowSize = 3;

        $scope.secondCategoryData = util.map(d, function(item){
            return {
                title : item.title,
                data : util.cutArrayByNum(item.data, rowSize)
            };
        });

        $scope.$apply();
        HW.helper.loading.hide();
    });
});